#include <OsgClassDataSource/CameraManipulatorOsg.h>
#include <iostream>
#include <osg/Group>
#include <NodeInfoContainer.h>
#include <SceneViewer.h>
CameraManipulatorOsg::CameraManipulatorOsg( QObject *parent /*= 0*/ ) : ObjectOsg(parent)
{
    m_object = NULL;

    this->refreshInfoContainer();
}


CameraManipulatorOsg::~CameraManipulatorOsg()
{

}


QVarintTrigger CameraManipulatorOsg::getTriggerSelectMe()
{
    return QVarintTrigger();
}

void CameraManipulatorOsg::setTriggerSelectMe(QVarintTrigger trigger)
{
    osg::ref_ptr<SwitchCameraManipulator> switchCameraMani = SceneViewer::instance()->getSwitchCameraManipulator();
    osgGA::CameraManipulator* cameraMani = dynamic_cast<osgGA::CameraManipulator*>(m_object.get());
    if(cameraMani != NULL)
    {
        int index = switchCameraMani->getCameraManipulatorIndex(cameraMani);
        if(index != -1)
        {
            switchCameraMani->selectCameraManipulator(index);
        }
    }
}
